﻿@model sBlog.Net.Areas.Admin.Models.AdminPostOrPageViewModel

@{
    ViewBag.Title = string.Format("Manage Pages || {0}", Model.Title);
}

@Html.ActionLink("All", "ManagePages", new { type = "all" })  (@Model.AllPostsCount ) |
@Html.ActionLink("Published", "ManagePages", new { type = "pub" }) (@Model.PublicPostsCount ) | 
@Html.ActionLink("Private", "ManagePages", new { type = "pri" }) (@Model.PrivatePostsCount ) | 

<span class="addPost">
    <img src="@Url.Content("~/Content/Images/page.png")" alt="Add a new page" class="add-post-page" />
    @Html.ActionLink("Add a new page", "Add", "Page") 
</span>
<br/><br/>
@if (Model.Posts != null && Model.Posts.Any())
{
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Page</th>
                <th class="hide-column">Author</th>
                <th>Categories</th>
                <th>Tags</th>
                <th>Comments</th>
                <th>Last Updated</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var post in Model.Posts)
            {
                @Html.Partial("PostDetail", post)
            }
        </tbody>
    </table>
}
else
{
    <div class="alert alert-warning">
        there are no items in this section at this point!
    </div>    
}

<ul class="pagination">
    @Html.PageLinks(Model.PagingInfo, x => Url.Action("ManagePages", new { page = x, type = Model.Type }))
</ul>
@Html.HiddenFor(model => Model.OneTimeCode)
